<?php
/**
 * Created by PhpStorm.
 * User: Evenvi
 * Date: 2015/3/25
 * Time: 16:59
 */

class Controller{
    protected $_model;
    protected $_controller;
    protected $_action;
    protected $_template;

    function __function($model, $controller, $action){
        $this->_controller = $controller;
        $this->_model = $model;
        $this->_action = $action;

        $this->$model = & new $model;
        $this->_template = & new Template($controller,$action);
    }

    function set($name, $value){
        $this->_template->set($name, $value);
    }

    function __destruct(){
        $this->_template->render();
    }
}



